/* UTF8 Encoding */
/*-----------------------------------------------------------------------
|                            FILE DESCRIPTION                           |
-----------------------------------------------------------------------*/
/*----------------------------------------------------------------------
  - File name     : tv_interface.hpp
  - Author        : liuzhihua (liuzhihuawy@163.com)
  - Update date   : 2023.08.15
  -	Brief         : TV interface
  - Version       : v0.1
-----------------------------------------------------------------------*/
/*-----------------------------------------------------------------------
|                               UPDATE NOTE                             |
-----------------------------------------------------------------------*/
/**
  * Update note:
  * ------------   ---------------   ----------------------------------
  *     Date            Author                      Note
  * ------------   ---------------   ----------------------------------
  *  2023.08.15       liuzhihua                  Create file          
***/

#ifndef TV_INTERFACE_HPP
#define TV_INTERFACE_HPP

/*-----------------------------------------------------------------------
|                               INCLUDES                                |
-----------------------------------------------------------------------*/

#include "bsp_uart.h"
/*-----------------------------------------------------------------------
|                                DEFINES                                |
-----------------------------------------------------------------------*/

typedef enum eVideoPlayMode
{
    PLAY_VIDEO_ONCE,          //单次播放
    PLAY_VIDEO_SEQUENCE,      //顺序播放
    PLAY_VIDEO_REPEAT_ALL,    //全部循环
    PLAY_VIDEO_REPEAT_SOLO,   //单曲循环
    PLAY_VIDEO_MODE_END
}eVideoPlayMode;


class tv_interface
{
    public:
        void playVideoInit(void)
        {
            Queue_Printf(&htx3, "FJDMOVIE");
        }
        void switchVideo(int id)
        {
            Queue_Printf(&htx3, "FJD%d", id);
        }
        void pauseVideo(void)
        {
            Queue_Printf(&htx3, "FJDPAUSE");
        }
        void continueVideo(void)
        {
            Queue_Printf(&htx3, "FJDPLAY");
        }
        void setVideoPlayMode(eVideoPlayMode mode)
        {
            const char modeTable[PLAY_VIDEO_MODE_END][10] = {"ONLYONE","SEQUENCE","RPTALL","RPTONE"};
            if ((int)mode >= PLAY_VIDEO_MODE_END) return;
            Queue_Printf(&htx3, "FJD%s", modeTable[mode]);
        }
        void stopVideoPlay(void)
        {
            Queue_Printf(&htx3, "FJDSTOP");
        }
    
};

/*-----------------------------------------------------------------------
|                                  API                                  |
-----------------------------------------------------------------------*/
extern tv_interface TVAPI;


#endif
